<table layout:fragment="goods_table" class="table table-striped table-bordered  table-advance table-hover" id="goods_grid" onload="myfunction()">
<thead>
	<tr>
		<th>商品名称</th>
		<th>货号</th>
		<th>价格</th>
		<th>促销价格</th>
	</tr>
</thead>	
<tbody>
	<tr class="odd gradeX" th:each="data : ${goodsPage}">
	
		<td th:text="${data.name}">
			 
		</td>
		
		<td th:text="${data.goodsSN}">
			 
		</td>
		
		<td th:text="${data.shopPrice}">
			 
		</td>
		<td>
			<div th:switch="${data.Promotion}">
				<p th:case="1">
				<span th:text="${data.promotionPrice}"></span>
				<a href="#" th:href="${data.id}+'_'+${salesPromotionId}+'_'+${goodsPage.number}" th:attr="id=${'link_delete_'+dataStat.index},name=${'link_delete_'+dataStat.index}" class="btn default btn-xs purple" onclick="del(event,this);"><i class="fa fa-minus"></i>移除</a>
				</p>
				<p th:case="0">
				<input type="text" style="width:160px;float:left;margin-right:10px;" placeholder="促销价格"  th:id="@{'promotion'+${data.id}}" class="form-control" />
			 	<a href="#" th:href="${data.id}+'_'+${salesPromotionId}+'_'+${goodsPage.number}" th:attr="id=${'link_addgoods_'+dataStat.index},name=${'link_addgoods_'+dataStat.index}" class="btn default btn-xs purple" style="margin-top:7px;" onclick="add(event,this);"><i class="fa fa-plus"></i>添加</a>
					</p>
				</div>
			</td>
			
					 
		</tr>
		
 	</tbody>
</table>
<div th:include="page_footer" th:with="viewState=${viewState},url=${'/promotion/salespromotiongoods/list/'+salesPromotionId+'/'},pageContext=${goodsPage}"></div>